define(["./WebPDF", "./PDFApi", "react", './component/Container',],
        function(WebPDF, PDFApi, React, Container) {   
        'use strict';	
	$.fn.pdfViewer = function(settings)
	{    
		return this.each(
			function()
			{
				var elem = $(this), pdfApi = elem.data('jsp');
				if (!pdfApi) {					
					var configs = {
						s3Key : settings.s3Key,
						baseUrl : '/pdfdata/'
					};									
					WebPDF.setConfig(configs);	
					pdfApi = new PDFApi(elem);				
					elem.data('jsp', pdfApi);
					var container = React.createElement(Container, {pdfApi: pdfApi});		
					React.render(container, this);
				}
				return false;
			}
		);
	};


	$.fn.pdfViewer.defaults = {
	};		
});